19. Defining the Model

06 Defining Model V2

Contiguous variables

If you are stacking up multiple LSTM outputs, it may be necessary to use .contiguous() to reshape the output. The notebook and Github repo code has been updated to include this use case in the forward function of the model:

# stack up LSTM outputs
out = out.contiguous().view(-1, self.n_hidden)